package ds.dsr.model;

import ds.dsr.enums.RetTipEnum;
import lombok.Data;

/**
 * @author sunchong
 * @date 2018/4/25
 */
@Data
public class RetJson<T> {

    private String code;

    private String msg;

    private T data;

    public void setTip(RetTipEnum retTipEnum){
        this.code = retTipEnum.getCode();
        this.msg = retTipEnum.getMsg();
    }

    public void success(T data){
        this.code = RetTipEnum.SUCCESS.getCode();
        this.msg = RetTipEnum.SUCCESS.getMsg();
        this.data = data;
    }
}
